package com.zhr.handler;

import com.zhr.server.WeixinRequest;
import com.zhr.server.WeixinResponse;
import com.zhr.type.MsgType;

public class MessageLinkHandler extends MessageAbstractHandler {

	@Override
	public WeixinResponse handle(WeixinRequest request) {
		WeixinResponse response = super.handle(request);
		response.setFuncFlag("1");
		response.setMsgType(MsgType.text.name());
		String responseContent = String.format(
				"title:%s,\ndescription:%s,\nurl:%s", request.getTitle(),
				request.getDescription(), request.getUrl());
		response.setContent(responseContent);
		return response;
	}

	@Override
	public int getPriority() {
		return MIN_PRIORITY;
	}

	@Override
	public boolean accpet(WeixinRequest request) {
		return true;
	}

}
